# 基础镜像
FROM mariadb:latest
# 传参
ENV MYSQL_ROOT_PASSWORD=root
# 创建数据库和用户
RUN echo "CREATE DATABASE wordpress;" >> /docker-entrypoint-initdb.d/init.sql
#    echo "CREATE DATABASE db2;" >> /docker-entrypoint-initdb.d/init.sql && \
#    echo "CREATE USER 'user1'@'%' IDENTIFIED BY 'password1';" >> /docker-entrypoint-initdb.d/init.sql && \
#    echo "CREATE USER 'user2'@'%' IDENTIFIED BY 'password2';" >> /docker-entrypoint-initdb.d/init.sql && \
#    echo "GRANT ALL PRIVILEGES ON db1.* TO 'user1'@'%';" >> /docker-entrypoint-initdb.d/init.sql && \
#    echo "GRANT ALL PRIVILEGES ON db2.* TO 'user2'@'%';" >> /docker-entrypoint-initdb.d/init.sql
